package com.theeviljames.coursework.server;

import java.io.DataOutputStream;
import java.net.Socket;
import java.util.Hashtable;
import java.util.Timer;
import java.util.TimerTask;

public class RadioServerTask extends Thread {

	private Socket client;
	private int delay;
	private int period;
	private RadioServerTimerTask timerTask;
	
	public RadioServerTask(Socket client, int delay, int period) {
		this.client = client;
		this.period = period;
		this.delay = delay;
	}
	
	public void run() {
		try {
			Timer timer = new Timer();
			DataOutputStream out = new DataOutputStream(client.getOutputStream());
			timerTask = new RadioServerTimerTask(out);
			timer.scheduleAtFixedRate(timerTask, delay, period);
		} catch (Exception e) {}
	}


}
